{template 'common/header'}
{template 'user/user-header'}
<form action="" method="post" class="we7-form" id="js-expire" ng-controller="UserExpireCtrl" ng-cloak>
	<div class="form-group">
		<label for="" class="control-label col-sm-2"  style="width: 150px;">提前天数</label>
		<div class="form-controls col-sm-8">
			<input type="text" ng-model = "user_expire.day">
			<span class="help-block">请填写天数，如果不填写，会在用户到期前一天发信息。</span>
		</div>
	</div>
	<div class="form-group">
		<label for="" class="control-label col-sm-2"  style="width: 150px;">是否启用</label>
		<div class="form-controls col-sm-8">
			<div class="switch" ng-class="{'switchOn' : user_expire.status}" ng-click="httpChange()"></div>
			<span class="help-block">默认为关闭状态，如果想对过期用户发送短信，需要开启。</span>
		</div>
	</div>
	<div class="form-group">
		<a href="{php echo url('cloud/sms-sign');}" class="btn btn-primary">短信签名设置</a>
	</div>
	<button type="button" class="btn btn-primary" ng-click="saveExpire()" ng-style="{'padding': '6px 50px'}">确定</button>
</form>
<script>
	angular.module('userManageApp').value('config', {
		'user_expire' : {php echo !empty($user_expire) ? json_encode($user_expire) : 'null'},
		'links' : {
			'user_expire_link' : "{php echo url('user/expire/save_expire')}",
			'user_expire_status_link' : "{php echo url('user/expire/change_status')}"
		}
	});
	angular.bootstrap($('#js-expire'), ['userManageApp']);
</script>
{template 'common/footer'}